# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=py3-networkx
pkgver=2.4
pkgrel=1
pkgdesc="Software for complex networks"
url="https://networkx.github.io/"
arch="noarch !mips64"
license="BSD-3-Clause"
depends="python3 py3-decorator"
makedepends="py3-setuptools"
subpackages="$pkgname-doc"
checkdepends="py3-pytest py3-pygraphviz py3-pydot py3-numpy py3-scipy py3-yaml
	py3-pandas py3-matplotlib py3-lxml cmd:xdg-open"
source="https://pypi.python.org/packages/source/n/networkx/networkx-$pkgver.tar.gz
	fix-matplotlib-deprecation.patch
	fix-test_numpy_type-under-python3.8.patch
	"
case "$CARCH" in
	x86|armhf|armv7|mips) options="$options !check" # Tests fail on 32-bit https://github.com/networkx/networkx/issues/4054
esac
builddir="$srcdir/networkx-$pkgver"

build() {
	python3 setup.py build
}

check() {
	# test in networkx/drawing/tests is incompatible with matplotlib >= 3.3.0
	# https://github.com/networkx/networkx/issues/4099
	pytest --ignore networkx/drawing/tests
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
}

sha512sums="38eabef56e3667b7fa85206ae01a0a8f5c71bfa2f324bc2490c433cb973508a03955183a0c58ae40390f86d6a4741135cdb426c4c15e53e2f123072f0cac1b89  networkx-2.4.tar.gz
8f7e59eb764ad5cd9f9baab67ee343e9a09259206f1d837037094737f47d252958946922deed9fd185766effadfa0dd51862c5b5b65f8d421311802f6bbe905e  fix-matplotlib-deprecation.patch
5ea12d580b771b4fd490c15dbb78fdfffb266d5d8f3ef53681ead8ee3376639000f134005158ec4d3a0261e0bf0f338540a5f73500c9e0fe15483e5c9f09ee77  fix-test_numpy_type-under-python3.8.patch"
